package com.accp.vehiclecare.action.lscaction;



import com.accp.vehiclecare.biz.lscbiz.UserBiz;
import com.accp.vehiclecare.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/c/user")
public class UserAction {
    @Autowired
    private UserBiz biz;

    @PostMapping("add")
    public int useraddone(@RequestBody User u){
        u.setUsertime(new Date());

        return biz.useraddone(u);
    }

    @GetMapping("querall")
    public List<User> querall(String usertj){
        return biz.querall(usertj);
    }

    @DeleteMapping("remone")
    public int removeone(Integer u){
        return biz.removeone(u);
    }

    @PutMapping("xg")
    public int modif(@RequestBody User u){
        return biz.modif(u);
    }

    @GetMapping("usno")
    public List<User> querbyuno(String usn){
        return biz.querbyuno(usn);
    }

    @GetMapping("qvip")
    public List<User> quervip(Integer vipid,String zhi){
        return biz.quervip(vipid,zhi);
    }

    @PutMapping("mvip")
    public int modifvip(@RequestBody User user){
        return biz.modifvip(user);
    }

    @PutMapping("mye")
    public int modifye(@RequestBody User user){
        return biz.modifye(user);
    }
}
